package com.week3.day03.homework2;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        FootballHashMap footballHashMap = new FootballHashMap();
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("=======================================================");
            System.out.println("1.输入年份，查询冠军队伍 \n2.输入球队，查询夺冠年份 \n3.退出系统");
            int n = scanner.nextInt();
            switch (n) {
                case 1:
                    System.out.println("输入年份");
                    String year = String.valueOf(scanner.nextInt());
                    System.out.println(footballHashMap.winner(year));
                    break;
                case 2:
                    System.out.println("输入球队");
                    String team = scanner.next();
                    if (footballHashMap.winYear(team) != null) {
                        System.out.println(footballHashMap.winYear(team));
                    } else {
                        System.out.println("没有获得过世界杯”");
                    }
                    break;
                case 3:
                    System.out.println("886");
                    return;
            }
        }
//        System.out.println(footballHashMap.winner("1990"));
//        System.out.println(footballHashMap.winYear("德国"));
    }
}
